//
//  PersonQRCodeController.m
//  Weiweiyunshi
//
//  Created by 张旭峰 on 2017/2/9.
//  Copyright © 2017年 王译. All rights reserved.
//

#import "PersonQRCodeController.h"

@interface PersonQRCodeController ()
@property (weak, nonatomic) IBOutlet UIImageView *titleimage;
@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UILabel *dept;

@property (weak, nonatomic) IBOutlet UIImageView *QRCodeimage;


@end

@implementation PersonQRCodeController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem .title = @"我的二维码";
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"header_back_icon"] style:UIBarButtonItemStyleDone target:self action:@selector(pop)];
    self.navigationItem.leftBarButtonItem = backItem;
//    [self.titleImage sd_setImageWithURL:[NSURL URLWithString:self.Model.img]];
    
//    NSURL *url = [NSURL URLWithString: self.Model.img];
//    // 获取的图片地址
//    
//    self.titleimage.image = [UIImage imageWithData: [NSData dataWithContentsOfURL:url]];
    
    //    self.name.text = Model.name;
//    [self.titleimage setImage:self.titleImage.image];
//    self.titleimage = self.titleImage;
    [self.titleimage setImage:self.titleImage];
    
    [self.name setText:self.Model.name];
    NSLog(@"------>>>><<<%@",self.Model.name);
    NSLog(@"------>>>><<<%@",self.name.text);
    
    //    self.dept.text = Model.dept;
    [self.dept setText:self.Model.dept];
    
    [self.QRCodeimage sd_setImageWithURL:[NSURL URLWithString:self.Model.qrcode]];

}
-(void)pop
{
    [self.navigationController popViewControllerAnimated:YES];
    
}
-(void)setModel:(MineModel *)Model
{
//    [self.titleimage sd_setImageWithURL:[NSURL URLWithString:Model.img]];
////    self.name.text = Model.name;
//    [self.name setText:Model.name];
//    
//    NSLog(@"------>>>><<<%@",Model.name);
//    NSLog(@"------>>>><<<%@",self.name.text);
//    
////    self.dept.text = Model.dept;
//    [self.dept setText:Model.dept];
//    
//    [self.QRCodeimage sd_setImageWithURL:[NSURL URLWithString:Model.qrcode]];
    _Model = Model;
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
